import pygame as pg
import pygame
import time
pygame.init()
screen=pygame.display.set_mode([640,550])
screen.fill([255,255,255])
a_a=True
while a_a==True:
    mouse_x, mouse_y = pg.mouse.get_pos()
    pygame.draw.rect(screen,[0,255,0],[mouse_x,mouse_y,100,100],50)
    pg.display.update()
    while mouse_x<100:
        a_a=False
    time.sleep(0.01)
pygame.quit()